package com.etms.controller;

import com.etms.pojo.IndexBox;
import com.etms.service.IndexService;
import com.etms.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("index")
public class IndexController {
    @Autowired
    IndexService indexService;

    @GetMapping("getMsg/{id}")
    public Result getMsg(@PathVariable("id") Integer id){
        return indexService.getMsgById(id);
    }

    @PostMapping("update")
    public Result update(@RequestBody IndexBox indexBox)
    {
        return indexService.updateIndex(indexBox);
    }
}
